Darling viewer: Query Store Regressions sub-tab (Dashboard parity)#1516
Merged
Conversation
Port the Dashboard's Query Store Regressions grid to the Darling viewer as a new Queries sub-tab, inserted at index 6 (after Query Store by Duration, matching the Dashboard's Query Store -> Query Store Regressions adjacency). Every sub-tab index uses a named constant, so Expensive Queries/Query Heatmap only shift. - ViewerDataService.QueryStoreRegressions.cs: the Postgres port of the Dashboard's report.query_store_regressions TVF against query_store_stats -- baseline (before the window) vs recent (in-window) averages split on collection_time, CPU-regression > 25% gate, execution-count-weighted added-duration ranking, TOP 50, duration-driven severity bands; honors the #1319 database filter; row VM reproduces every column. - Loader + switch case + constant (Queries.cs), FilterManager (Filters.cs), double-click history reusing QueryStoreHistoryWindow with plan_id 0 (History.cs), plan-less Copy Repro from the query-text sample (CopyExport.cs), and the XAML sub-tab (QueryGridRowStyle, no slicer/comparison -- matching the Dashboard grid and the sibling grid-only tabs). - Tests: SQL string pins (base table, baseline/recent split, CPU gate, ranking/cap, severity, casts, DB filter, PG dialect), row display, key mapper, Copy Repro, and a gated live round-trip (baseline-vs-recent detection). Darling-only: no Lite, Full Dashboard, or install/*.sql changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Ports the Dashboard's Query Store Regressions grid to the Darling viewer as a new Queries sub-tab — the missing regressions GRID over the Query Store data Darling already collects. It ranks queries whose Query Store performance regressed (recent window vs. baseline).
Ported from the Dashboard: the SQL (
GetQueryStoreRegressionsAsync→ thereport.query_store_regressionsinline TVF,install/47_create_reporting_views.sql), the model (Dashboard/Models/QueryStoreRegressionItem.cs), and the grid (QueryStoreRegressionsDataGrid,QueryPerformanceContent.xaml).Sub-tab placement (named-constant alignment)
Inserted at index 6, right after
Query Store by Duration— matching the Dashboard's Query Store → Query Store Regressions adjacency and mirroring how PR #1515 inserted Current Active Queries. Every reference uses a NAMED constant, so only the tail shifts:The XAML
<TabItem>order matches the constants exactly (verified: Performance Trends, Active Queries, Current Active Queries, Top Queries, Top Procedures, Query Store by Duration, Query Store Regressions, Expensive Queries, Query Heatmap).The Postgres regression SQL
ViewerDataService.QueryStoreRegressions.csadapts the TVF to Postgres againstquery_store_stats: two windowed CTEs (BASELINE = captures before the window; RECENT = the window), joined per(database, query_id), computing duration/CPU/IO regression %, execution-count-weightedadditional_duration_ms, plan-count deltas, and a duration-driven severity band — keeping rows whose CPU regressed > 25% (the TVF's gate), ranked by added duration, TOP 50.Faithful adaptations (all documented in the read's XML doc):
collection_time(Darling's UTC window column), not the TVF'sserver_last_execution_time(Darling's local-wall-clock column — mixing it with UTC bounds would be a tz bug).MAX(query_text)(Darling stores it decompressed; the TVFDECOMPRESS()es).Parity wiring (sibling conventions)
DataGridFilterManagerper Darling convention; [FEATURE] Add filter for databases(s) #1319 database filter honored ($4::text[]).QueryStoreHistoryWindow(plan_id 0, query-scoped), mirroring the Dashboard grid and the sibling Query Store tab.QueryGridRowStylemenu offers Copy Repro (functional from the query-text sample) + copy/export.Tests (
dotnet test Darling/Darling.Testsgreen — 2102 passed, 0 failed)collection_time, CPU > 25% gate, added-duration ranking +LIMIT 50, severity thresholds, bigint/integer casts, unit conversion, [FEATURE] Add filter for databases(s) #1319 filter, PG positional dialect (added to the shared Queries dialect Theory).DARLING_TEST_PG-gated live round-trip proving baseline-vs-recent detection, the CPU gate, INNER-JOIN NEW-query exclusion, and the CRITICAL severity + added-duration math.Darling-only — no Lite, Full Dashboard, or
install/*.sqlchanges. Viewer + service build clean.🤖 Generated with Claude Code